package com.excesys.exsecs.energy.service;

import cn.hutool.core.lang.tree.Tree;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.excesys.exsecs.energy.entity.DevAreaMap;
import com.excesys.exsecs.energy.entity.DimArea;

import java.util.List;
import java.util.Map;

public interface DimAreaService extends IService<DimArea> {

    List<Tree<Long>> queryTree(DimArea dimArea);

    DimArea getAreaById(Long id);

    /**
     * 保存或更新部门与关联表计的关系
     */
    boolean saveDevAreaMap(DimArea dimArea);

    /**
     * 删除部门及关联表计关系和分区关系
     */
    boolean removeAreaBatchByIds(List<Long> ids);

    List<DevAreaMap> getMetersById(DimArea dimArea);

    JSONObject powerAreaSanchitou(String id, String startDate, String endDate);

    JSONObject powerAreaBingtu(String startDate, String endDate);

    /*
     * 能耗报表
     * */
    List<Map<String, Object>> getAreaReportPage(String ids, String date);

    /*
     * 能耗对比
     * */
    JSONObject powerAreaContrast(String ids, String startDate, String endDate);

    /*
     * 区域能耗排序
     * */
    List<Map<String, Object>> areaSort(String ids, String startDate, String endDate, String order, String energyType);

    /*
     * 区域能耗排序 - 水
     * */
    List<Map<String, Object>> areaSortWaterRank(String ids, String startDate, String endDate, String order, String energyType);

    /*
     * 区域能耗排名
     * */
    JSONObject areaRanking(String ids, String date,String order);
}